#pragma once

#include <string.h>
#include <stdlib.h>

// const size_t size = 1024;

#define SIZE 1024

enum{
    FLUSH_NOW = 1,
    FLUSH_LINE,
    FLUSH_ALL
};

typedef struct IO_FILE
{
    int fileno;     // 文件描述符编号
    int flag;
    char in_buffer[SIZE];
    int in_pos;
}_FILE;

_FILE* _fopen(const char* filename, const char* flag);
int _fwrite(_FILE* fp, const char* s, int len);
void _fclose(_FILE* fp);